package com.zyh.service.impl;

import com.zyh.entity.User;
import com.zyh.mapper.UserMapper;
import com.zyh.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class UserServiceImpl implements UserService {


    @Autowired
    UserMapper mapper;
    @Override
    public void insert(User user) {
        mapper.insert(user);
    }

    @Override
    public User selectByNameAndPassword(String name, String password) {
        return mapper.selectByNameAndPassword(name, password);
    }

    @Override
    public void delete(int id) {
        mapper.delete(id);
    }

    @Override
    public void update(User user) {
        mapper.update(user);
    }

    @Override
    public User selectById(int id) {
        return mapper.selectById(id);
    }

    @Override
    public List<User> selectAll() {
        return mapper.selectAll();
    }
}
